#include "luster_status.hh"

namespace luster {

#define DESCRIPTION_OK "Ok"
#define DESCRIPTION_ERROR "General error"
#define DESCRIPTION_EOF "End of file or input"
#define DESCRIPTION_LIST_CLOSE "Reach end of file or input before list close"
#define DESCRIPTION_STRING_CLOSE \
	"Reach end of file or input before string close"
#define DESCRIPTION_NO_KEYWORD "Undefined keyword"
#define DESCRIPTION_LEADING_CHAR "Invalid leading char"
#define DESCRIPTION_ARGS_COUNT_ERR "Invalid argument count"
#define DESCRIPTION_TYPE_ERROR "Type error"

char const *status_description(Status status) {
	static char const *descriptions[] = {
#define _(M_NAME) DESCRIPTION_##M_NAME,
		STATUS_MAP(_)
#undef _
	};

	return descriptions[status];
}

} // namespace luster
